package leetcode.easy;

/**
 * ClassName: $338_CountBits
 * Description:
 * date: 2022-02-19 18:20
 *
 * @author liyifan
 */
public class $338_CountBits {
    public int[] countBits(int n) {
        int[] res = new int[n + 1];
        for (int i = 0;i <= n;i++) {
            res[i] = Integer.bitCount(i);
        }
        return res;
    }
}
